package com.bdqn.gulimall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bdqn.common.utils.PageUtils;
import com.bdqn.gulimall.member.entity.MemberEntity;
import com.bdqn.gulimall.member.exception.PhoneException;
import com.bdqn.gulimall.member.exception.UserNameExistException;
import com.bdqn.gulimall.member.vo.MemberLoginVo;
import com.bdqn.gulimall.member.vo.MemberRegistVo;
import com.bdqn.gulimall.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员表
 *
 * @author cxk&xp&fg
 * @email 200224242@qq.com
 * @date 2022-01-20 16:23:36
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 登录
     * @param vo
     */
    void regist(MemberRegistVo vo);



    /**\
     * 检查手机号唯一性
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneException;


    /**\
     * 检查用户名唯一性
     * @param serName
     * @return
     */
    void checkUserNameUnique(String serName) throws UserNameExistException;

    /**
     * 普通用户登录
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    /**
     * 社交用户登录
     * @param vo
     * @return
     */
    MemberEntity login(SocialUser vo);
}

